import request from '@/utils/request'
import store from '@/store/'

// 查询系统通告列表
export function listAnnouncement(query) {
  return request({
    url: '/message/announcement/list',
    method: 'get',
    params: query
  })
}

// 查询系统通告详细
export function getAnnouncement(id) {
  return request({
    url: '/message/announcement/' + id,
    method: 'get'
  })
}

// 新增系统通告
export function addAnnouncement(data) {
  return request({
    url: '/message/announcement',
    method: 'post',
    data: data
  })
}

// 修改系统通告
export function updateAnnouncement(data) {
  return request({
    url: '/message/announcement',
    method: 'put',
    data: data
  })
}

// 删除系统通告
export function delAnnouncement(id) {
  return request({
    url: '/message/announcement/' + id,
    method: 'delete'
  })
}

// 发布系统通知
export function publishAnnouncement(){
  return request({
    url:'/message/announcement/listByUser',
    method:'get'
  })
}
// 发布按钮
export function publishButton(id){
  return request({
    url:'message/announcement/doReleaseData/'+id,
    method:'get'
  })
}

// 获取系统通知
export function getPublishAnnouncement(query){
  return request({
    url:'/message/send/getMyAnnouncementSend',
    method:'get',
    params: query
  })
}

// 撤销按钮
export function revokeAnnouncement(id){
  return request({
    url:'message/announcement/doReovkeData/' + id,
    method:'get'
  })
}

// 更新阅读状态
export function renewReadStatus(anntId){
  return request({
    url:'/message/announcement/syncNotice/' + anntId,
    method:'get'
  })
}
